<!DOCTYPE html>
<html lang="en">
<head>
    <title>区域报表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_855021_i2jfy4r0uq.css">
    <link rel="stylesheet" href="/dist/css/oa-app.css">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
</head>
<style>
    [v-cloak] {
        display: none;
    }

    * {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        font-size: 12px;
    }

    body {
        margin: 1px;
        background: #fff;
    }

    .boxBoy {
        background: #fff;
    }

    table {
        border-spacing: 0;
        border-collapse: collapse;
        display: table;
    }

    .weather {
        text-align: center;
        font-size: 16px;
        position: absolute;
        top: 5px;
        line-height: 30px;
        float: left;
    }

    th {
        font-weight: normal;
    }

    table.text-center, table.text-center td, table.text-center th {
        text-align: center;
        font-size: 12px;
    }

    .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
        border: 1px solid #cbcbcd;
        height: 28px;
        position: relative;
        color: #333;
        padding: 0 4px;
    }

    table th {
        background: #f8f8f8;
    }

    .table-bordered {
        border: 1px solid #cbcbcd;
    }

    .table {
        width: 100%;
        max-width: 100%;
    }

    .hidden {
        display: none;
    }

    .lineOne, .lineTwo {
        text-align: left;
    }

    .tdColor {
        background-color: #f8f8f8;
        font-weight: normal;
    }

    .lineOne span {
        max-height: 24px;
        line-height: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-align: left;
    }

    .lineTwo span {
        max-height: 55px;
        line-height: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        text-align: left;
        padding: 5px;

    }

    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }

    .div-td-content-more i {
        width: 15px;
        height: 12px;
        background: url("/dist/img/more-icon.png");
        position: absolute;
        left: 50px;
        top: -12px;
    }

    .clear {
        clear: both
    }

    .boxItem {
        width: 100%;
        margin-top: 5px;
        background: inherit;
        /*background-color: rgba(255, 255, 255, 1);*/
        border: none;
        position: relative;
    }

    .boxItemTitle {
        color: #2c8cec;
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 6px;
        text-align: center;
    }

    .home {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 10px;
        height: 14px;
        line-height: 14px;
        text-align: center;
    }

    .dian-icon {
        background: url("/dist/img/dian.png") no-repeat;
        background-size: cover;
        width: 14px;
        height: 14px;
        display: inline-block;
    }

    .jiaobiao, .jiaobiaoNew {
        position: relative;
    }

    .jiaobiao i {
        display: block;
        width: 0;
        height: 0;
        border-width: 0px 0 12px 12px;
        border-style: solid;
        border-color: transparent transparent transparent #2a8cec;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .jiaobiaoNew i {
        display: block;
        width: 12px;
        height: 12px;
        background: url("/dist/img/newLog2.png");
        background-size: 100% 100%;
        position: absolute;
        top: 0px;
        left: 0px;
    }

    .lineImg {
        padding-top: 5px !important;
        padding-bottom: 10px !important;
    }

    .lineImg img {
        height: 45px;
        width: 45px;
        float: left;
        margin: 10px;
    }

    .newCustomer {
        background: url(/dist/img/new.png) no-repeat;
        background-size: cover;
        width: 20px;
        height: 20px;
        right: 0;
        top: 2px;
        position: absolute;
    }

    .wajueji {
        padding-left: 140px;
        background: url("/dist/img/wajueji.png") no-repeat;
        background-size: 120px 88px;
        height: 88px;
        line-height: 88px;
        color: red;
        font-size: 14px;
        font-weight: bold;
        margin-left: 50px;
    }

    .qipao {
        /*background: url(/dist/img/qipao.png);*/
        background-size: 100% 100%;
        height: 88px;
        /* padding: 0 20px; */
        padding-left: 20px;
        /*padding-right: 20px;*/
        color: red;
        line-height: 88px;
        float: left;
        font-size: 14px;
        font-weight: bold;
    }

    .plan1 {
        background: url("/dist/img/plan1.png") no-repeat center center;
        background-size: 100%;
    }

    .plan2 {
        background: url("/dist/img/plan2.png") no-repeat center center;
        background-size: 100%;
    }

    .plan3 {
        background: url("/dist/img/plan3.png") no-repeat center center;
        background-size: 100%;
    }

    .boxItemTitleNotice {
        color: red;
        font-size: 22px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNotice i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 22px;
        width: 22px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .boxItemTitleNoticeTime {
        color: red;
        font-size: 20px;
        font-weight: bold;
        margin-bottom: 10px;
        text-align: center;
    }

    .boxItemTitleNoticeTime i {
        background: url("/dist/img/jg.png") no-repeat center center;
        height: 16px;
        width: 16px;
        background-size: cover;
        display: inline-block;
        margin-bottom: -3px;
        margin-left: 5px;
    }

    .search-button {
        width: 14px;
        height: 14px;
        background-image: url(/dist/img/glass.jpg);
        border: 0 none;
        cursor: pointer;
        margin-top: 0px;
    }

    input[type=button] {
        outline: none;
    }

    .oaBtn {
        background: url(/dist/img/btn-bj2.png) repeat-y !important;
        background-size: 100% 100% !important;
        color: #fff !important;
    }

    .btn-group-sm > .btn, .btn-sm {
        padding: 2px 10px;
    }

    .btn {
        border-radius: 3px;
        -webkit-box-shadow: none;
        box-shadow: none;
        border: 1px solid transparent;
    }

    .pull-right {
        float: right !important;
    }

    .blue {
        color: #39c;
    }

    .red {
        color: #e03800;
    }

    .weather img {
        height: 30px;
        width: 30px;
        float: left;
    }

    .icon-zhankai, .icon-shouqi {
        cursor: pointer;
        border-radius: 5px;
        float: right;
        font-weight: bold;
    }

    .templateStyle {
        margin-top: 15px;
        margin-left: 10px;
        margin-right: 10px;
    }

</style>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div class="templateStyle" style="margin-top: 10px;">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="3" class="tableTitle">
                            <span style="margin-left: 16px;">面访客户</span>
                            <span class="iconfont icon-zhankai" v-if="btns==0"
                                  @click="btns=1"></span>
                            <span class="iconfont icon-shouqi" v-if="btns==1"
                                  @click="btns=0"></span>
                        </td>
                    </tr>
                    <tr>
                        <!--:class="customer.newCustomer=='1'?'tdColor jiaobiaoNew':'tdColor jiaobiao'"-->
                        <td class="tdColor" style="width: 30%;"></td>
                        <td class="tdColor" style="width: 40%;">日期
                        </td>
                        <td class="tdColor" style="width: 30%;">完成</td>
                    </tr>
                    <template v-if="btns==0">
                        <tr v-for="(item,i) in faceCustomer" v-if="i<5">
                            <td :rowspan="item.weekspan" :class="{hidden: item.weekdis}">
                                {{item.week}}
                            </td>
                            <td>{{item.date}}</td>
                            <td v-if="item.num>0" style="color: #2a8cec;cursor: pointer;"
                                @click="openReportDetail('faceCustomer',item.date)">{{item.num}}
                            </td>
                            <td v-else>
                                {{item.num}}
                            </td>
                        </tr>
                    </template>
                    <template v-else>
                        <tr v-for="(item,i) in faceCustomer">
                            <td :rowspan="item.weekspan" :class="{hidden: item.weekdis}">
                                {{item.week}}
                            </td>
                            <td>{{item.date}}</td>
                            <td v-if="item.num>0" style="color: #2a8cec;cursor: pointer;"
                                @click="openReportDetail('faceCustomer',item.date)">{{item.num}}
                            </td>
                            <td v-else>
                                {{item.num}}
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">合计</td>
                            <td>{{faceCustomer.finishCount}}</td>
                        </tr>
                    </template>

                    </tbody>
                </table>
                <table v-if="btns==0" class="table table-bordered text-center table-width" style="margin-top: -1px">
                    <!--收起状态-->
                    <tbody>
                        <tr v-for="(item,i) in Fcustomer">
                            <td style="width: 70%;">本月新增</td>
                            <td v-if="item.newNum>0" style="width: 30%;color: #2a8cec;cursor: pointer;"
                                @click="openReportDetails('newCustomer',dateTime.substring(0,7),'1')">
                                {{item.newNum}}
                            </td>
                            <td v-else-if="item.newNum==''">
                                0
                            </td>
                            <td v-else>
                                {{item.newNum}}
                            </td>
                        </tr>
                        <tr v-for="(item,i) in Fcustomer">
                            <td style="width: 70%;">总数量</td>
                            <td v-if="item.sunNum>0" style="width: 30%;color: #2a8cec;cursor: pointer;"
                                @click="openReportDetails('allCustomer',dateTime.substring(0,7),'1')">
                                {{item.sunNum}}
                            </td>
                            <td v-else-if="item.sunNum==''">
                                0
                            </td>
                            <td v-else>
                                {{item.sunNum}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <!--<div class="templateStyle">-->
    <!--<div class="boxItem">-->
    <!--<div class="boxBoy">-->
    <!--<table class="table table-bordered text-center table-width">-->
    <!--<tbody>-->
    <!--<tr>-->
    <!--<td colspan="2" style="background: #2a8cec;color: #fff;">面访客户管理</td>-->
    <!--</tr>-->
    <!--<tr>-->
    <!--<td class="tdColor" style="width: 50%;">本月新增</td>-->
    <!--<td class="tdColor" style="width: 50%;">总数量</td>-->
    <!--</tr>-->
    <!--<tr v-for="(item,i) in Fcustomer">-->
    <!--<td v-if="item.newNum>0" style="color: #2a8cec;cursor: pointer;"-->
    <!--@click="openReportDetails('newCustomer',dateTime.substring(0,7),'1')">-->
    <!--{{item.newNum}}-->
    <!--</td>-->
    <!--<td v-else-if="item.newNum==''">-->
    <!--0-->
    <!--</td>-->
    <!--<td v-else>-->
    <!--{{item.newNum}}-->
    <!--</td>-->
    <!--<td v-if="item.sunNum>0" style="color: #2a8cec;cursor: pointer;"-->
    <!--@click="openReportDetails('allCustomer',dateTime.substring(0,7),'1')">-->
    <!--{{item.sunNum}}-->
    <!--</td>-->
    <!--<td v-else-if="item.sunNum==''">-->
    <!--0-->
    <!--</td>-->
    <!--<td v-else>-->
    <!--{{item.sunNum}}-->
    <!--</td>-->
    <!--</tr>-->
    <!--</tbody>-->
    <!--</table>-->
    <!--</div>-->
    <!--<div class="clear"></div>-->
    <!--</div>-->
    <!--</div>-->
    <div class="templateStyle">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="3" class="tableTitle">
                            <span style="margin-left: 16px;">电访客户</span>
                            <span class="iconfont icon-zhankai" v-if="btn1==0"
                                  @click="btn1=1"></span>
                            <span class="iconfont icon-shouqi" v-if="btn1==1"
                                  @click="btn1=0"></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 30%;"></td>
                        <td class="tdColor" style="width: 40%;">日期
                        </td>
                        <td class="tdColor" style="width: 30%;">完成</td>
                    </tr>
                    <template v-if="btn1==0">
                        <tr v-for="(item,i) in telCustomer" v-if="i<5">
                            <td :rowspan="item.weekspan" :class="{hidden: item.weekdis}">
                                {{item.week}}
                            </td>
                            <td>{{item.date}}</td>
                            <td v-if="item.num>0" style="color: #2a8cec;cursor: pointer;"
                                @click="openReportDetail('telCustomer',item.date)">{{item.num}}
                            </td>
                            <td v-else>
                                {{item.num}}
                            </td>
                        </tr>
                    </template>
                    <template v-else>
                        <tr v-for="(item,i) in telCustomer">
                            <td :rowspan="item.weekspan" :class="{hidden: item.weekdis}">
                                {{item.week}}
                            </td>
                            <td>{{item.date}}</td>
                            <td v-if="item.num>0" style="color: #2a8cec;cursor: pointer;"
                                @click="openReportDetail('telCustomer',item.date)">{{item.num}}
                            </td>
                            <td v-else>
                                {{item.num}}
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">合计</td>
                            <td>{{telCustomer.finishCount}}</td>
                        </tr>
                    </template>
                    </tbody>
                </table>

                <table v-if="btn1==0" class="table table-bordered text-center table-width" style="margin-top: -1px">
                    <!--收起状态-->
                    <tbody>
                    <tr v-for="(item,i) in Tcustomer">
                        <td style="width: 70%;">本月新增</td>
                        <td v-if="item.newNum>0" style="width: 30%;color: #2a8cec;cursor: pointer;"
                            @click="openReportDetails('newCustomer',dateTime.substring(0,7),'0')">
                            {{item.newNum}}
                        </td>
                        <td v-else-if="item.newNum==''">
                            0
                        </td>
                        <td v-else>
                            {{item.newNum}}
                        </td>
                    </tr>
                    <tr v-for="(item,i) in Tcustomer">
                        <td style="width: 70%;">总数量</td>
                        <td v-if="item.sunNum>0" style="width: 30%;color: #2a8cec;cursor: pointer;"
                            @click="openReportDetails('allCustomer',dateTime.substring(0,7),'0')">
                            {{item.sunNum}}
                        </td>
                        <td v-else-if="item.sunNum==''">
                            0
                        </td>
                        <td v-else>
                            {{item.sunNum}}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <!--<div class="templateStyle">-->
    <!--<div class="boxItem">-->
    <!--<div class="boxBoy">-->
    <!--<table class="table table-bordered text-center table-width">-->
    <!--<tbody>-->
    <!--<tr>-->
    <!--<td colspan="2" style="background: #2a8cec;color: #fff;">电访客户管理</td>-->
    <!--</tr>-->
    <!--<tr>-->
    <!--<td class="tdColor" style="width: 50%;">本月新增</td>-->
    <!--<td class="tdColor" style="width: 50%;">总数量</td>-->
    <!--</tr>-->
    <!--<tr v-for="(item,i) in Tcustomer">-->
    <!--<td v-if="item.newNum>0" style="color: #2a8cec;cursor: pointer;"-->
    <!--@click="openReportDetails('newCustomer',dateTime.substring(0,7),'0')">-->
    <!--{{item.newNum}}-->
    <!--</td>-->
    <!--<td v-else-if="item.newNum==''">-->
    <!--0-->
    <!--</td>-->
    <!--<td v-else>-->
    <!--{{item.newNum}}-->
    <!--</td>-->
    <!--<td v-if="item.sunNum>0" style="color: #2a8cec;cursor: pointer;"-->
    <!--@click="openReportDetails('allCustomer',dateTime.substring(0,7),'0')">-->
    <!--{{item.sunNum}}-->
    <!--</td>-->
    <!--<td v-else-if="item.sunNum==''">-->
    <!--0-->
    <!--</td>-->
    <!--<td v-else>-->
    <!--{{item.sunNum}}-->
    <!--</td>-->
    <!--</tr>-->
    <!--</tbody>-->
    <!--</table>-->
    <!--</div>-->
    <!--<div class="clear"></div>-->
    <!--</div>-->
    <!--</div>-->
    <div class="templateStyle">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="4" class="tableTitle">销售目标及意向客户</td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 25%;"><i></i>目标</td>
                        <td class="tdColor" style="width: 25%;">已完成</td>
                        <td class="tdColor" style="width: 25%;">奖励金额</td>
                        <td class="tdColor" style="width: 25%;">罚款金额</td>
                    </tr>
                    <tr v-for="(item,i) in xsTarget">
                        <td>{{item.targetNum}}</td>
                        <td>{{item.finishNum}}</td>
                        <td>{{item.saleReward}}</td>
                        <td>{{item.salePunishment}}</td>
                    </tr>
                    <template v-if="yxCustomer&&yxCustomer.length>0">
                    <tr >
                        <td class="tdColor" style="width: 25%;">客户姓名</td>
                        <td class="tdColor" style="width: 25%;">意向型号</td>
                        <td class="tdColor" style="width: 25%;">购买方式</td>
                        <td class="tdColor" style="width: 25%;">预计购买<br>时间</td>
                    </tr>
                    <tr v-for="(item,i) in yxCustomer">
                        <td class="lineOne">
                            <span style="text-align: center;color: #2a8cec;" @click="openYXCustomer(item)">
                                {{item.name}}
                            </span>
                        </td>
                        <td>{{item.intentionModel}}</td>
                        <td>{{item.buyType}}</td>
                        <td>{{changeBuyDate(item.buyDate)}}</td>
                    </tr>
                    </template>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>

    <div class="templateStyle" style="margin-bottom: 15px;">
        <div class="boxItem">
            <div class="boxBoy">
                <table class="table table-bordered text-center table-width">
                    <tbody>
                    <tr>
                        <td colspan="6" class="tableTitle">
                            <span style="margin-left: 16px;">微信转发及好友数</span>
                            <span class="iconfont icon-zhankai" v-if="btn2==0"
                                  @click="btn2=1"></span>
                            <span class="iconfont icon-shouqi" v-if="btn2==1"
                                  @click="btn2=0"></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 25%;">日期</td>
                        <td class="tdColor" style="width: 15%;">应转发</td>
                        <td class="tdColor" style="width: 15%;">已转发</td>
                        <td class="tdColor" style="width: 15%;">未转发</td>
                        <td class="tdColor" style="width: 15%;">好友数</td>
                        <td class="tdColor" style="width: 15%;">今日<br>新增</td>
                    </tr>
                    <template v-if="btn2==0">
                        <tr v-for="(item,i) in weChat" v-if="i<5">
                            <td>{{item.date}}</td>
                            <td>{{item.forward}}</td>
                            <td>{{item.finishForward}}</td>
                            <td style="color: red;">{{Math.abs(item.forward-item.finishForward)}}
                            </td>
                            <td>{{item.contacts}}</td>
                            <td>{{Math.abs(item.num)}}</td>
                        </tr>
                    </template>
                    <template v-else>
                        <tr v-for="(item,i) in weChat">
                            <td>{{item.date}}</td>
                            <td>{{item.forward}}</td>
                            <td>{{item.finishForward}}</td>
                            <td style="color: red;">{{Math.abs(item.forward-item.finishForward)}}
                            </td>
                            <td>{{item.contacts}}</td>
                            <td>{{Math.abs(item.num)}}</td>
                        </tr>
                    </template>
                    </tbody>
                </table>
            </div>
            <div class="clear"></div>
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>

<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: "#app",
        data: {
            userId: getUrlParamObj().userId,
            dateTime: getUrlParamObj().dateTime,
            Fcustomer: {},
            Tcustomer: {},
            weChat: {},
            xsTarget: {},
            yxCustomer: {},
            faceCustomer: {
                finishCount: 0
            },
            telCustomer: {
                finishCount: 0
            },
            btns: 0,
            btn1: 0,
            btn2: 0,
        },
        methods: {
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
            changeBuyDate:function(buyDate){
                var a='';
                switch (buyDate) {
                    case 'todayMonth':
                        a='本月内'
                        break
                    case 'nextMonth':
                        a='下月内'
                        break
                    case 'threeMonth':
                        a='三月内'
                        break
                    case 'halfYear':
                        a='半年内'
                        break
                }
                return a;
            },

            //获取面访及电访客户
            get_faceCustomer: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newReportForm.getVisitCustomerByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "type": '1'
                }, function (data) {
                    console.log(data.records)
                    that.faceCustomer = data.records.filter(function (element, i, self) {
                        //按周区分
                        self[i]['week'] = that.getWeek(self[i].date)
                        if (self[i].date <= that.dateTime) {
                            return true;
                        }
                    })
                    that.faceCustomer = that.tablesMergeCell(that.faceCustomer)
                    that.faceCustomer.finishCount = that.getCount(that.faceCustomer, "num");
                });
                $.wyui.postMethod(urlConfig.newReportForm.getVisitCustomerByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "type": '0'
                }, function (data) {
                    console.log(data.records)
                    that.telCustomer = data.records.filter(function (element, i, self) {
                        self[i]['week'] = that.getWeek(self[i].date)
                        if (self[i].date <= that.dateTime) {
                            return true;
                        }
                    })
                    that.telCustomer = that.tablesMergeCell(that.telCustomer)
                    that.telCustomer.finishCount = that.getCount(that.telCustomer, "num");
                });
            },
            //获取销售目标及意向客户
            get_yxCustomer: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newReportForm.getSale, {
                    "userId": that.userId,
                    "dateTime": that.dateTime
                }, function (data) {
                    console.log(data.records)
                    that.xsTarget = data.records;
                });
                $.wyui.postMethod(urlConfig.newReportForm.getForPersonalIntentCustomerList, {
                    "userId": that.userId,
                    "dateTime": that.dateTime
                }, function (data) {
                    console.log(data.records)
                    that.yxCustomer = data.records;
                });
            },
            //获取客户管理
            get_Fcustomer: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newReportForm.getCustomerNumByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "type": 1
                }, function (data) {
                    console.log(data)
                    that.Fcustomer = data;
                });
            },
            get_Tcustomer: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newReportForm.getCustomerNumByUserIdAndDateTime, {
                    "userId": that.userId,
                    "dateTime": that.dateTime,
                    "type": 0
                }, function (data) {
                    console.log(data)
                    that.Tcustomer = data;
                });
            },
            //获取微信转发及好友数
            get_weChat: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.newReportForm.getWechatShareList, {
                    "userId": that.userId,
                    "dateTime": that.dateTime
                }, function (data) {
                    console.log(data.records)
                    that.weChat = data.records.filter(function (element, i, self) {
                        if (self[i].date <= that.dateTime) {
                            return true;
                        }
                    })
                });
            },
            getWeek: function (str) {
                var day = new Date(str).Format('d')
                if (day > 0 && day <= 7) {
                    return "第1周"
                }
                if (day > 7 && day <= 14) {
                    return "第2周"
                }
                if (day > 14 && day <= 21) {
                    return "第3周"
                }
                if (day > 21) {
                    return "第4周"
                }

                /* // 将字符串转为标准时间格式
                 str = Date.parse(str);
                 str = new Date(str);
                 // 先计算出该日期为第几周
                 var week = Math.ceil(str.getDate() / 7);
                 var month = str.getMonth() + 1;
                 // 判断这个月前7天是周几，如果不是周一，则计入上个月
                 if (str.getDate() < 7) {
                     if (str.getDay() !== 1) {
                         week = 5;
                         month = str.getMonth();
                     }
                 }
                 console.log(month+'-'+week);*/
            },
//合并单元格
            tablesMergeCell: function (list) {
                if (list != undefined && list && list.length > 0) {
                    for (field in list[0]) {
                        var k = 0;
                        while (k < list.length) {
                            list[k][field + 'span'] = 1;
                            list[k][field + 'dis'] = false;
                            for (var i = k + 1; i <= list.length - 1; i++) {
                                if (list[k][field] == list[i][field] && list[k][field] != '') {
                                    list[k][field + 'span']++;
                                    list[k][field + 'dis'] = false;
                                    list[i][field + 'span'] = 1;
                                    list[i][field + 'dis'] = true;
                                } else {
                                    break;
                                }
                            }
                            k = i;
                        }
                    }
                }
                return list;
            },
            openReportDetail: function (type, dateTime) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newReportForm/quYuReportDetailApp.html?userId=' + getUrlParamObj().userId + '&type=' + type + '&dateTime=' + dateTime,
                    name: '客户列表'
                }
                prompt(JSON.stringify(obj))
            },
            openReportDetails: function (type, dateTime, state) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/newReportForm/quYuReportDetailApp.html?userId=' + getUrlParamObj().userId + '&type=' + type + '&dateTime=' + dateTime + '&state=' + state,
                    name: '客户列表'
                }
                prompt(JSON.stringify(obj))
            },
            //打开意向客户详情
            openYXCustomer: function (item) {
                var obj = {
                    type: 'customerList',
                    url: '/reportForm/customer/intentionalCustomerBigRegionApp.html?customerId=' +item.id,
                    name:''
                }
                prompt(JSON.stringify(obj))
            },
        },
        mounted: function () {
            var that = this;
            that.get_faceCustomer();
            that.get_yxCustomer();
            that.get_Fcustomer();
            that.get_Tcustomer();
            that.get_weChat();
        }
    })
</script>
</body>
</html>
